using System.ComponentModel.DataAnnotations;

namespace StudentManagement.Application.DTOs;

public class ScoreDTO
{
    public int Id { get; set; }
    
    [Required(ErrorMessage = "学生ID不能为空")]
    public int StudentId { get; set; }
    
    [Required(ErrorMessage = "课程ID不能为空")]
    public int CourseId { get; set; }
    
    [Range(0, 100, ErrorMessage = "期中考试成绩必须在0到100之间")]
    public decimal? MidtermScore { get; set; }
    
    [Range(0, 100, ErrorMessage = "期末考试成绩必须在0到100之间")]
    public decimal? FinalScore { get; set; }
    
    [Range(0, 100, ErrorMessage = "总成绩必须在0到100之间")]
    public decimal? TotalScore { get; set; }
    
    [StringLength(10, ErrorMessage = "等级长度不能超过10个字符")]
    public string Grade { get; set; }
    
    public DateTime UpdateDate { get; set; }
    
    // 用于显示的学生信息
    public string StudentName { get; set; }
    public string StudentIdNumber { get; set; }
    
    // 用于显示的课程信息
    public string CourseName { get; set; }
    public string CourseCode { get; set; }
}